flag_features: Vec<String>,
flag_all_features: bool,
flag_no_default_features: bool,
- flag_avoid_dev_deps: bool,
flag_target: Option<String>,
flag_manifest_path: Option<String>,
flag_verbose: u32,
--features FEATURES Space-separated list of features to also build
--all-features Build all available features
--no-default-features Do not build the `default` feature
- --avoid-dev-deps Avoid installing dev-dependencies if possible
--target TRIPLE Build for the target triple
--manifest-path PATH Path to the manifest to compile
-v, --verbose ... Use verbose output (-vv very verbose/build.rs output)
let root = find_root_manifest_for_wd(options.flag_manifest_path, config.cwd())?;
let mut ws = Workspace::new(&root, config)?;
- if options.flag_avoid_dev_deps {
+ if config.cli_unstable().avoid_dev_deps {
ws.set_require_optional_deps(false);
}
pub unstable_options: bool,
pub offline: bool,
pub no_index_update: bool,
+ pub avoid_dev_deps: bool,
}
impl CliUnstable {
"unstable-options" => self.unstable_options = true,
"offline" => self.offline = true,
"no-index-update" => self.no_index_update = true,
+ "avoid-dev-deps" => self.avoid_dev_deps = true,
_ => bail!("unknown `-Z` flag specified: {}", k),
}
// True if this workspace should enforce optional dependencies even when
// not needed; false if this workspace should only enforce dependencies
- // needed by the current configuration (such as in cargo install).
+ // needed by the current configuration (such as in cargo install). In some
+ // cases `false` also results in the non-enforcement of dev-dependencies.
require_optional_deps: bool,
}